package com.training.java.core.collections.pre15;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/**
 * This demo is to observe the list behavior with Laptop object
 * 
 * @author soumya
 * 
 */
public class LaptopImmutableDemo {

	public static void main(String[] args) {

		LaptopImmutable lenovo = new LaptopImmutable("Lenovo", "T410", 13);
		LaptopImmutable dell = new LaptopImmutable("Dell", "Inspiron", 12);
		LaptopImmutable mac = new LaptopImmutable("Mac", "Retina", 13);

		List Laptops = new ArrayList();

		// Adding the laptops to the list

		Laptops.add(lenovo);
		Laptops.add(dell);
		Laptops.add(mac);

		// reading from the list

		Iterator Laptopsite = Laptops.iterator();

		System.out
				.println("These are the Laptops available. Please contact store associate for help !!");

		System.out.println("  ");

		while (Laptopsite.hasNext()) {
			LaptopImmutable laptop = (LaptopImmutable) Laptopsite.next();

			System.out.println(" Laptop make : " + laptop.getMake());
			System.out.println(" Laptop model : " + laptop.getModel());
			System.out
					.println(" Laptop screenSize : " + laptop.getScreenSize());
			System.out.println(" ");
		}

	}

}
